package br.com.fafica.sisape.view;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.ImageIcon;

import br.com.fafica.sisape.control.ControllerUsuario;

import java.awt.Font;
import java.awt.TextArea;

public class TelaUsuarioHistorico extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TelaUsuarioHistorico frame = new TelaUsuarioHistorico();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public TelaUsuarioHistorico() {
		setResizable(false);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 270, 410);
		contentPane = new JPanel();
		contentPane.setBackground(Color.WHITE);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel label = new JLabel("");
		label.setIcon(new ImageIcon("arquivos\\telaHistoricoUsuario.png"));
		label.setBounds(36, 0, 168, 65);
		contentPane.add(label);
		
		JLabel lblNome = new JLabel("Nome:");
		lblNome.setForeground(new Color(0, 0, 128));
		lblNome.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblNome.setBounds(10, 77, 46, 14);
		contentPane.add(lblNome);
		
		JLabel lblTxtnome = new JLabel("txtNome:");
		lblTxtnome.setForeground(new Color(0, 0, 128));
		lblTxtnome.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblTxtnome.setBounds(56, 78, 188, 14);
		contentPane.add(lblTxtnome);
		lblTxtnome.setText(ControllerUsuario.logado.getNome());
		
		JLabel lblCpf = new JLabel("Cpf:");
		lblCpf.setForeground(new Color(0, 0, 128));
		lblCpf.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblCpf.setBounds(10, 102, 46, 14);
		contentPane.add(lblCpf);
		
		JLabel txtCpf = new JLabel("txtNome:");
		txtCpf.setForeground(new Color(0, 0, 128));
		txtCpf.setFont(new Font("Tahoma", Font.PLAIN, 12));
		txtCpf.setBounds(56, 103, 188, 14);
		contentPane.add(txtCpf);
		txtCpf.setText(ControllerUsuario.logado.getCpf());
		
		TextArea textArea = new TextArea();
		textArea.setBounds(10, 134, 234, 227);
		contentPane.add(textArea);
		ControllerUsuario control = new ControllerUsuario();
		textArea.setText(control.carregaHistorico(control.codUserLogado()));
	}
}
